<template>
	<el-dialog v-model="visible" :width="350" destroy-on-close align-center>
		<!-- <el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px">
			<el-form-item label="设备名称" prop="name">
				<el-input v-model="form.name" readonly></el-input>
			</el-form-item>
			<el-form-item label="设备编号" prop="code">
				<el-input v-model="form.code" readonly></el-input>
			</el-form-item>
			<el-form-item label="设备二维码" prop="qrcode">
                <img :src="form.qrcode" alt="">
			</el-form-item>
            <el-form-item label="设备编号" prop="apply">
				<el-input v-model="form.apply" readonly></el-input>
			</el-form-item>
		</el-form> -->
        <div class="info">
            <div>{{form.name}}</div>
            <div>{{form.code}}</div>
            <img :src="form.qrcode" alt="">
            <div>{{form.apply}}</div>       <!-- 组织名称-->
        </div>
	</el-dialog>
</template>

<script>
	export default {
		emits: ['success', 'closed'],
		data() {
			return {
				mode: "add",
				titleMap: {
					add: '新增',
					edit: '编辑',
					show: '查看'
				},
				visible: false,
				isSaveing: false,
				//表单数据
				form: {
					code:"",
					name: "",
					qrcode: "",
                    apply:"",
				},
			}
		},
		mounted() {
		},
		methods: {
			//显示
			open(mode='add'){
				this.mode = mode;
				this.visible = true;
				return this
			},
			//表单注入数据
			setData(data){
                console.log('data :>> ', data);
				this.form.code = data.code
				this.form.name = data.title
				this.form.qrcode = data.qrcode
                this.form.apply = data.apply_title
			}
		}
	}
</script>

<style>
.info{
    display: flex;
    flex-direction: column;
    align-items: center;
}
</style>
